import 'package:flutter/material.dart';

import '../utils/screen_util.dart';

class PanButton extends StatelessWidget {

  final Color color;
  final String text;
  final Object callback;
  final double height;

  PanButton({Key key, this.color=Colors.black, this.text='按钮', this.callback, this.height=68}) : super(key: key);

  @override
  Widget build(BuildContext context) {

    ScreenAdapter.init(context);

    return InkWell(
      onTap: callback,
      child: Container(
        margin: EdgeInsets.all(5),
        padding: EdgeInsets.all(5),
        height: ScreenAdapter.height(height),
        width: double.infinity,
        decoration: BoxDecoration(
          color: color,
          borderRadius: BorderRadius.circular(10)
        ),
        child: Center(
          child: Text('$text', style: TextStyle(
            color: Colors.white
          ))
        )
      )
    );
  }
}